package com.dt76.smallloanbackendservice.service.zjs.impl;


import com.dt76.smallloanbackendservice.mapper.zjs.MemberMapper;

import com.dt76.smallloanbackendservice.pojo.zjs.Member;

import com.dt76.smallloanbackendservice.service.zjs.MemberService;

import com.dt76.smallloanbackendservice.utils.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MemberServiceImpl implements MemberService {

    @Autowired
    private MemberMapper memberMapper;
    @Override
    public Page qryAllMember(int pageIndex) {
        Page page = new Page();
        page.setPageIndex(pageIndex);//每次更新当前页
        //更新总条数
        page.setTotalCount(memberMapper.qryCount());
        List<Member> memberList = memberMapper.qryAllMember((page.getPageIndex()-1)*page.getPageSize(),
                page.getPageSize());
        page.setRows(memberList);

        return page;
    }




}
